<template lang="pug">
  el-breadcrumb.breadcrumb-nav(
    separator-class="el-icon-arrow-right")
    //- el-breadcrumb-item(:to="{ path: '/' }") 昆明手机抄表平台
    el-breadcrumb-item(
      v-for="item in breadcrumbList"
      :key="item.id"
      )
      span(@click="changeUrl(item)") {{item.label}}
</template>
<script>
/* 墁霓啊，重写，main去掉，el-breadcrumb，el-breadcrumb-item */
import { fullPath } from '../nav'
export default {
  name: 'Breadcrumb',
  props: {
    routesPure: Array
  },
  computed: {
    breadcrumbList () {
      // console.log('this.$route', this.$route.matched)
      let urlArr = fullPath(this.$route, this.routesPure)
      // urlArr = urlArr.filter(url => url.type !== 'SYSTEM')
      return urlArr
    }
  },
  methods: {
    changeUrl (item) {
      if (item.type === 'SYSTEM') return
      window.location.href = item.url
    }
  }
}
</script>
<style scoped lang="sass">
.breadcrumb-nav
  font-size: 14px
  margin-left: 20px
  cursor: pointer
</style>
